CREATE TABLE [dbo].[tb_TiposDeMueblesYEquipos]
(
[idTipoDeMueble] [int] NOT NULL IDENTITY(1, 1),
[Descripcion] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE TRIGGER [dbo].[updateTipoMuebles] ON [dbo].[tb_TiposDeMueblesYEquipos] 
FOR UPDATE
AS
if (update(idTipoDeMueble)) begin
	UPDATE tb_MueblesYEquipos 
	SET TipoDeMueble = (SELECT idTipoDeMueble from inserted)
	WHERE TipoDeMueble in (SELECT idTipoDeMueble from deleted)
end
GO
ALTER TABLE [dbo].[tb_TiposDeMueblesYEquipos] ADD CONSTRAINT [PK_tb_TiposDeMueblesYEquipos] PRIMARY KEY NONCLUSTERED  ([idTipoDeMueble]) ON [PRIMARY]
GO
